package com.zlt.bkparking.controller.checked;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zlt.bkparking.service.CheckingService;
import com.zlt.bkparking.vo.CheckedVO;
import com.zlt.bkparking.vo.Result;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("carAddress")
@Api(value = "Swagger调试",tags = "Swagger 调试")
@Slf4j
public class CheckingController {

    @Autowired
    private CheckingService checkingService;

    @GetMapping("CheckingCar")
    public Result CheckingCar( Integer pageNum,Integer pageSize){
      //  System.out.println(1);
        if(pageNum == null){
            pageNum = 1;
        }
        if(pageSize == null){
            pageSize = 10;
        }
        PageInfo<CheckedVO> info = checkingService.getInfo( pageNum, pageSize);
        return Result.ok("查询成功",info);
    }

    @GetMapping("userD")
    public Result TellUser( ){
        //System.out.println(1);
        System.out.println(666666);
        PageInfo<CheckedVO> info = checkingService.UserD( );
        return Result.ok("告知成功",info);
    }

    @GetMapping("resetUser")
    public Result ResetUser(Integer ids){
        System.out.println(666);
        System.out.println(ids);

        PageInfo<CheckedVO> info = checkingService.ResetU( );
        return Result.ok("告知成功",info);
    }


}
